package com.css.openapi.service.impl;


import cn.hutool.json.JSONUtil;

import com.css.common.core.exception.ServiceException;
import com.css.common.core.session.SessionUtils;
import com.css.common.core.utils.BaseUtil;
import com.css.openapi.BO.ZrrXsecxRep;
import com.css.openapi.feign.ZfjkpPtCommonClient;
import com.css.openapi.service.ApiFzService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Map;

/**
 * @description:辅助api服务实现类
 */
@Slf4j
@Service
public class ApiFzServiceImpl implements ApiFzService {

    @Resource
    private ZfjkpPtCommonClient zfjkpPtCommonClient;

    @Override
    public ZrrXsecxRep queryZrrxse(Map<String,String> param) {
        String appid= SessionUtils.getAppid();
        log.info("自然人销售额入参：{},appid:{}", JSONUtil.toJsonStr(param),appid);
        String zrrxm=param.get("zrrxm");
        String zrrSfzjhm=param.get("zrrSfzjhm");
        if(BaseUtil.isNull(zrrxm)||BaseUtil.isNull(zrrSfzjhm)){
            throw new ServiceException("自然人姓名或自然人身份证件号码不能为空");
        }
        return zfjkpPtCommonClient.queryZrrxse(param);

    }
}
